<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">×
            </button>
            <h4 class="modal-title" id="myModalLabel">
                                        添加JOB任务
            </h4>
         </div>
         <div class="modal-body">
             <div class="box box-success">
                <!-- form start -->
                <form role="form" id="addjobForm">
                 <input type="hidden" name="httptype" id="httptype" value="">
                 <input type="hidden" name="isConcurrent" id="isConcurrent" value="">
                 
                  <div class="box-body">
                    <div class="form-group">
                      <label for="jobName">URL地址</label>
                      <input type="url" class="form-control" id="jobName" name="jobName" value="${jobName}" placeholder="URL地址" readonly>
                    </div>
                    <div class="form-group">
                      <label for="cronstr">quartz cron 表达式</label>&nbsp;&nbsp;<a href="#" onclick="showHelp();" class="btn btn-info btn-xs"><span class="glyphicon glyphicon-question-sign"></span>示例</a>
                      <input type="text" class="form-control" id="cronstr" name="cronstr" value="${cronStr}" placeholder="请填写正确的 quartz cron 表达式" required>
                    </div>
                    <div class="form-group">
                      <label >HTTP请求方式:</label>
                      <span id="httptypeName" ></span>
                    </div>
                    <div class="form-group">
                      <label >任务执行方式:</label>
                      <span id="isConcurrent2"></span>
                    </div>
                    
                    <div class="form-group">
                      <label for="jobDesc">任务描述[20字以内]</label>
                      <input type="text" class="form-control" id="jobDesc" name="jobDesc" placeholder="任务描述[20字以内]" required>
                    </div>
                    
                  </div><!-- /.box-body -->
                </form>
				<div id="error-block" class="alert alert-error hide" >
				  <a class="close" onclick="closeMessage();">×</a>
				  <strong>Error!</strong>
				  <div id="addjoberrormsgs">fasdfads</div>
				</div>
              </div><!-- /.box -->                     
                                 
         </div>
         <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal">关闭
            </button>
            <button id="btn_save_job" type="button" class="btn btn-primary" onclick="fn_edit_job();">
                                                 保存
            </button>
         </div>
      </div><!-- /.modal-content -->
   </div><!-- /.modal-dialog -->
   <script>
   
   $(function () {
     var httptype = '${httptype}';
     if(httptype && httptype == '1'){
    	 $('#httptypeName').html("GET");
    	 $('#httptype').val('1');
     }else{
    	 $('#httptypeName').html("POST");
    	 $('#httptype').val('0');
     }
     var isConcurrent = '${isConcurrent}';
     if(isConcurrent)$('#isConcurrent').val(isConcurrent);
     if(isConcurrent && isConcurrent == '1'){
    	 $('#isConcurrent2').html("可并行");
     }else{
    	 $('#isConcurrent2').html("串行执行");
     }
     
     var jobDesc = '${jobDesc}';
     if(jobDesc){
    	 $('#jobDesc').val(jobDesc);
     }
     
     
     
   });
   </script>